package ch2;

import java.util.Scanner;

public class YongHu {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        MiMa aa = new MiMa();
        aa.admin="whb";
        aa.password=123456;
        while (true) {
            System.out.print("请输入用户名：");
            String a = input.next();
            if (a.equals("n")) {
                return;
            }
            System.out.print("请输入密码：");
            int b = input.nextInt();
          if (aa.admin.equals(a)&& aa.password == b) {
                System.out.print("请输入新密码：");
                aa.password = input.nextInt();
                System.out.println("修改密码成功，您的新密码是：" + aa.password);
            } else {
                System.out.println("用户名和密码不匹配！您没有权限更新管理员信息。");
            }
        }
    }
}
